Skip to content

samples: tflite_ethosu: fix compile errors #88218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

ccli8
Copy link
Collaborator

@ccli8 ccli8 commented Apr 7, 2025

This tries to fix some compile errors in the tflite_ethosu sample, including:

  1. Fix undefined _fini symbol on invoking exit() for newlib libc
  2. Add missing inclusion of stdint.h for e.g. uint8_t type
  3. Fix unsafe thread stack allocation. Use canonical
    K_THREAD_STACK_DEFINE or friends instead of raw buffer

ccli8 added 3 commits April 7, 2025 10:08
With gcc command-line options -nostartfiles or -nostdlib, the gcc
built-in object files crti.o/crtn.o which implement _init/_fini
won't get linked in automatically and will cause undefined reference
to _fini error when exit is invoked.

This is fixed by providing one dummey _fini to let linker pass.

Signed-off-by: Chun-Chieh Li <[email protected]>
Add header file stdint.h so that fixed width integer type
e.g. uint8_t can use without compile error.

Signed-off-by: Chun-Chieh Li <[email protected]>
It is unsafe to pass raw buffer as thread stack. Instead, use canonical
K_THREAD_STACK_DEFINE or friends to define thread stack.

Signed-off-by: Chun-Chieh Li <[email protected]>
@ccli8 ccli8 force-pushed the samples_tflm_ethosu_fix_error branch from 1483485 to c5f6668 Compare April 7, 2025 02:10
@ccli8
Copy link
Collaborator Author

ccli8 commented Apr 15, 2025

Hi, please take a look.

Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Jun 15, 2025
@github-actions github-actions bot closed this Jun 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants